﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.ServiceModel;
using Celeriq.Utilities;
using Celeriq.Common;

namespace Celeriq.Graphing.Core
{
	[ServiceContract]
	public interface ISystemCore
	{
		[OperationContract]
		RemotingObjectCache StartRepository(Guid serverId, UserCredentials credentials);
	
		[OperationContract]
		RemotingObjectCache StopRepository(Guid serverId, UserCredentials credentials);

		[OperationContract]
		RemotingObjectCache DataLoadRepository(Guid serverId, UserCredentials credentials);

		[OperationContract]
		List<RemotingObjectCache> GetRepositoryPropertyList(UserCredentials credentials);

		[OperationContract]
		RemotingObjectCache SaveRepository(RepositoryDefinition repository, UserCredentials credentials);

		[OperationContract]
		bool RepositoryExists(Guid serverId, UserCredentials credentials);

		[OperationContract]
		void DeleteRepository(RepositoryDefinition repository, UserCredentials credentials);

		[OperationContract]
		void ShutDown();

		[OperationContract]
		void RestartRepositories();

		[OperationContract]
		bool Backup(Guid repositoryId, UserCredentials credentials, string backupFile);

		[OperationContract]
		bool Restore(Guid repositoryId, UserCredentials credentials, string backupFile);

		[OperationContract]
		bool ExportSchema(Guid repositoryId, UserCredentials credentials, string backupFile);

		[OperationContract]
		string[] GetBackups(UserCredentials credentials);

		[OperationContract]
		void Compress(Guid serverId, UserCredentials credentials);

		[OperationContract]
		string GetPublicKey();

		[OperationContract]
		bool IsValidCredentials(UserCredentials credentials);

		[OperationContract]
		ServerResourceSettings GetServerResourceSetting(UserCredentials credentials);

		[OperationContract]
		bool SaveServerResourceSetting(UserCredentials credentials, ServerResourceSettings settings);

		[OperationContract]
		ProfileItem[] GetProfile(Guid repositoryId, UserCredentials credentials, long lastProfileId);

	}
}
